package main;

import java.sql.Connection;

import database.DBConnection;
import responsehandler.ResponseHandler;
import twitterfeed.TweetStream;

/**
 * Main file of the program. Is called when the program is started.
 * 
 * @author Project group 9
 * 
 */
public class Start {

	private TweetStream tStream;
	private Thread responseHandlerThread;

	public Start() {
		init();
	}

	public static void main(String[] args) {
		Start start = new Start();
		start.run();
	}

	public void run() {
//		tStream.startNow();
		responseHandlerThread.start();
	}

	public void init() {
		Connection con = DBConnection.getDBConnection().getConnection();
		tStream = new TweetStream(con);
		responseHandlerThread = new Thread(new ResponseHandler(con));
	}
	
	public TweetStream getTweetStream() { 
		return tStream;
	}
	
	public Thread getResponseHandler() { 
		return responseHandlerThread;
	}
}
